<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card'
      autocomplete="off">

    <div class="layui-card-body">

        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs5 think-form-label">分类名称</label>
            <label class="layui-col-xs4">
                <input name="name" required value='{$vo.name|default=""}' placeholder="请输入分类名称" class="layui-input">
            </label>
        </div>

        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs5 think-form-label">分类类型</label>
            <label class="layui-col-xs2">
                <select class="layui-select" required name="type">
                    {foreach [''=>'- 全部类型 -','1'=>'外链','0'=>'本地'] as $k=>$v}
                    {if isset($vo.type) and $vo.type eq $k}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/if}
                    {/foreach}
                </select>
            </label>
        </div>

        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs5 think-form-label">分类位置</label>
            <label class="layui-col-xs2">
                <select class="layui-select" required name="type">
                    {foreach ['0'=>'导航','1'=>'工具'] as $k=>$v}
                    {if isset($vo.istools) and $vo.istools eq $k}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/if}
                    {/foreach}
                </select>
            </label>
        </div>

        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs5 think-form-label">编码</label>
            <label class="layui-col-xs4">
                <input name="code" required value='{$vo.code|default=""}' placeholder="请输入编码" class="layui-input">
            </label>
        </div>

        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs5 think-form-label">分类地址</label>
            <label class="layui-col-xs5">
                <input name="href" required value='{$vo.href|default="#"}' placeholder="请输入链接地址" class="layui-input">
            </label>
        </div>

        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs5 think-form-label">排序</label>
            <label class="layui-col-xs5">
                <input name="sort" required value='{$vo.sort|default="100"}' placeholder="" type="number" class="layui-input">
            </label>
        </div>

    </div>

    <div class="hr-line-dashed"></div>
    <div class="layui-form-item text-center">
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
